package lab02.test27;

import java.util.InputMismatchException;
import java.util.Scanner;
public class Test27 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int cout1 = 0;
        try {
            cout1 = scanner.nextInt();//可能出错的语句
        }catch (InputMismatchException e){
            e.printStackTrace();//打印异常信息
            System.out.println("0");
        } finally {

            System.out.println("输入异常！！！");
        }
        System.out.println(cout1);
    }
}
